package cn.yuanqiao.archive.collection.appManager.domain;

import cn.yuanqiao.common.annotation.Excel;
import cn.yuanqiao.common.exception.ServiceException;
import cn.yuanqiao.common.utils.StringUtils;
import cn.yuanqiao.common.core.domain.BaseEntity;
import cn.yuanqiao.common.utils.SecurityUtils;
import org.apache.commons.lang3.builder.ToStringBuilder;

/**
 * 资料树类别Mapper接口
 *
 * @ProjectName: ruoyi-modules-system
 * @Package: cn.yuanqiao.archive.appManager.domain
 * @ClassName: YqDataCategory
 * @Author: lenovo
 * @Description: hbWang
 * @Date: 2023/7/28 14:11
 * @Version: 1.0
 */

public class YqDataCategory extends BaseEntity {
    private static final long serialVersionUID = 1L;

    private final String BIGTABLENAME = "_YQ_DATA_CATEGORY";

    private String tableName;

    public YqDataCategory() {
        String tenantCode = SecurityUtils.getTenantCode();
        if (StringUtils.isEmpty(tenantCode)) {
            throw new ServiceException("TenantCode is null");
        } else {
            this.tableName = tenantCode.toUpperCase() + BIGTABLENAME;
        }
    }

    public String getTableName() {
        return tableName;
    }

    public void setTableName(String tableName) {
        this.tableName = tableName;
    }


    /**
     * 序号
     */
    @Excel(name = "序号")
    private String num;

    /**
     * 类别主键
     */
    private String id;

    /**
     * 树的code
     */
    @Excel(name = "资料树编码")
    private String treeCode;

    /**
     * 类号名称
     */
    @Excel(name = "类号名称")
    private String categoryName;

    /**
     * 类号代码
     */
    @Excel(name = "类号代码")
    private String categoryCode;

    /**
     * 顺序
     */
    @Excel(name = "顺序")
    private String orderNum;

    /**
     * 控制属性
     */
    @Excel(name = "控制属性", readConverterExp = "1=控制,2=开发"
            , combo = "控制,开发")
    private String controlType;

    /**
     * 备注
     */
    @Excel(name = "备注")
    private String remarks;

    /**
     * 创建人
     */
    private String creator;

    /**
     * 创建人id
     */
    private String creatorId;

    public String getNum() {
        return num;
    }

    public void setNum(String num) {
        this.num = num;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getTreeCode() {
        return treeCode;
    }

    public void setTreeCode(String treeCode) {
        this.treeCode = treeCode;
    }

    public String getCategoryName() {
        return categoryName;
    }

    public void setCategoryName(String categoryName) {
        this.categoryName = categoryName;
    }

    public String getCategoryCode() {
        return categoryCode;
    }

    public void setCategoryCode(String categoryCode) {
        this.categoryCode = categoryCode;
    }

    public String getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(String orderNum) {
        this.orderNum = orderNum;
    }

    public String getControlType() {
        return controlType;
    }

    public void setControlType(String controlType) {
        this.controlType = controlType;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public String getCreator() {
        return creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public String getCreatorId() {
        return creatorId;
    }

    public void setCreatorId(String creatorId) {
        this.creatorId = creatorId;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this)
                .append("num", num)
                .append("id", id)
                .append("treeCode", treeCode)
                .append("categoryName", categoryName)
                .append("categoryCode", categoryCode)
                .append("orderNum", orderNum)
                .append("controlType", controlType)
                .append("remarks", remarks)
                .append("creator", creator)
                .append("creatorId", creatorId)
                .toString();
    }
}
